package com.xiaoyi.intentsdklibrary.Bean;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

public class ShareBeanDao extends AbstractDao<ShareBean, Long> {
    public static final String TABLENAME = "SHARE_BEAN";

    public static class Properties {
        public static final Property Account_id = new Property(3, String.class, "account_id", false, "ACCOUNT_ID");
        public static final Property Checked_flag = new Property(19, Boolean.TYPE, "checked_flag", false, "CHECKED_FLAG");
        public static final Property Date = new Property(20, String.class, "date", false, "DATE");
        public static final Property Down_sum = new Property(18, Integer.TYPE, "down_sum", false, "DOWN_SUM");
        public static final Property Enabled_down = new Property(16, Boolean.TYPE, "enabled_down", false, "ENABLED_DOWN");
        public static final Property Grade_num = new Property(21, Integer.TYPE, "grade_num", false, "GRADE_NUM");
        public static final Property Id = new Property(0, Long.class, "id", true, "_id");
        public static final Property Need_acc_point = new Property(17, Integer.TYPE, "need_acc_point", false, "NEED_ACC_POINT");
        public static final Property Phone_size = new Property(13, String.class, "phone_size", false, "PHONE_SIZE");
        public static final Property Script_action_sum = new Property(11, String.class, "script_action_sum", false, "SCRIPT_ACTION_SUM");
        public static final Property Script_context = new Property(8, String.class, "script_context", false, "SCRIPT_CONTEXT");
        public static final Property Script_id = new Property(1, String.class, "script_id", false, "SCRIPT_ID");
        public static final Property Script_img = new Property(6, String.class, "script_img", false, "SCRIPT_IMG");
        public static final Property Script_name = new Property(4, String.class, "script_name", false, "SCRIPT_NAME");
        public static final Property Script_note = new Property(7, String.class, "script_note", false, "SCRIPT_NOTE");
        public static final Property Script_pwd = new Property(10, String.class, "script_pwd", false, "SCRIPT_PWD");
        public static final Property Script_size = new Property(9, String.class, "script_size", false, "SCRIPT_SIZE");
        public static final Property Script_type_code = new Property(2, String.class, "script_type_code", false, "SCRIPT_TYPE_CODE");
        public static final Property Script_type_id = new Property(5, String.class, "script_type_id", false, "SCRIPT_TYPE_ID");
        public static final Property Soft_code = new Property(14, String.class, "soft_code", false, "SOFT_CODE");
        public static final Property Soft_version_code = new Property(15, String.class, "soft_version_code", false, "SOFT_VERSION_CODE");
        public static final Property User_scene = new Property(12, String.class, "user_scene", false, "USER_SCENE");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return true;
    }

    public ShareBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public ShareBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"SHARE_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"SCRIPT_ID\" TEXT UNIQUE ,\"SCRIPT_TYPE_CODE\" TEXT,\"ACCOUNT_ID\" TEXT,\"SCRIPT_NAME\" TEXT,\"SCRIPT_TYPE_ID\" TEXT,\"SCRIPT_IMG\" TEXT,\"SCRIPT_NOTE\" TEXT,\"SCRIPT_CONTEXT\" TEXT,\"SCRIPT_SIZE\" TEXT,\"SCRIPT_PWD\" TEXT,\"SCRIPT_ACTION_SUM\" TEXT,\"USER_SCENE\" TEXT,\"PHONE_SIZE\" TEXT,\"SOFT_CODE\" TEXT,\"SOFT_VERSION_CODE\" TEXT,\"ENABLED_DOWN\" INTEGER NOT NULL ,\"NEED_ACC_POINT\" INTEGER NOT NULL ,\"DOWN_SUM\" INTEGER NOT NULL ,\"CHECKED_FLAG\" INTEGER NOT NULL ,\"DATE\" TEXT,\"GRADE_NUM\" INTEGER NOT NULL );");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"SHARE_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, ShareBean shareBean) {
        databaseStatement.clearBindings();
        Long id = shareBean.getId();
        if (id != null) {
            databaseStatement.bindLong(1, id.longValue());
        }
        String script_id = shareBean.getScript_id();
        if (script_id != null) {
            databaseStatement.bindString(2, script_id);
        }
        String script_type_code = shareBean.getScript_type_code();
        if (script_type_code != null) {
            databaseStatement.bindString(3, script_type_code);
        }
        String account_id = shareBean.getAccount_id();
        if (account_id != null) {
            databaseStatement.bindString(4, account_id);
        }
        String script_name = shareBean.getScript_name();
        if (script_name != null) {
            databaseStatement.bindString(5, script_name);
        }
        String script_type_id = shareBean.getScript_type_id();
        if (script_type_id != null) {
            databaseStatement.bindString(6, script_type_id);
        }
        String script_img = shareBean.getScript_img();
        if (script_img != null) {
            databaseStatement.bindString(7, script_img);
        }
        String script_note = shareBean.getScript_note();
        if (script_note != null) {
            databaseStatement.bindString(8, script_note);
        }
        String script_context = shareBean.getScript_context();
        if (script_context != null) {
            databaseStatement.bindString(9, script_context);
        }
        String script_size = shareBean.getScript_size();
        if (script_size != null) {
            databaseStatement.bindString(10, script_size);
        }
        String script_pwd = shareBean.getScript_pwd();
        if (script_pwd != null) {
            databaseStatement.bindString(11, script_pwd);
        }
        String script_action_sum = shareBean.getScript_action_sum();
        if (script_action_sum != null) {
            databaseStatement.bindString(12, script_action_sum);
        }
        String user_scene = shareBean.getUser_scene();
        if (user_scene != null) {
            databaseStatement.bindString(13, user_scene);
        }
        String phone_size = shareBean.getPhone_size();
        if (phone_size != null) {
            databaseStatement.bindString(14, phone_size);
        }
        String soft_code = shareBean.getSoft_code();
        if (soft_code != null) {
            databaseStatement.bindString(15, soft_code);
        }
        String soft_version_code = shareBean.getSoft_version_code();
        if (soft_version_code != null) {
            databaseStatement.bindString(16, soft_version_code);
        }
        long j = 1;
        databaseStatement.bindLong(17, shareBean.getEnabled_down() ? 1 : 0);
        databaseStatement.bindLong(18, (long) shareBean.getNeed_acc_point());
        databaseStatement.bindLong(19, (long) shareBean.getDown_sum());
        if (!shareBean.getChecked_flag()) {
            j = 0;
        }
        databaseStatement.bindLong(20, j);
        String date = shareBean.getDate();
        if (date != null) {
            databaseStatement.bindString(21, date);
        }
        databaseStatement.bindLong(22, (long) shareBean.getGrade_num());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, ShareBean shareBean) {
        sQLiteStatement.clearBindings();
        Long id = shareBean.getId();
        if (id != null) {
            sQLiteStatement.bindLong(1, id.longValue());
        }
        String script_id = shareBean.getScript_id();
        if (script_id != null) {
            sQLiteStatement.bindString(2, script_id);
        }
        String script_type_code = shareBean.getScript_type_code();
        if (script_type_code != null) {
            sQLiteStatement.bindString(3, script_type_code);
        }
        String account_id = shareBean.getAccount_id();
        if (account_id != null) {
            sQLiteStatement.bindString(4, account_id);
        }
        String script_name = shareBean.getScript_name();
        if (script_name != null) {
            sQLiteStatement.bindString(5, script_name);
        }
        String script_type_id = shareBean.getScript_type_id();
        if (script_type_id != null) {
            sQLiteStatement.bindString(6, script_type_id);
        }
        String script_img = shareBean.getScript_img();
        if (script_img != null) {
            sQLiteStatement.bindString(7, script_img);
        }
        String script_note = shareBean.getScript_note();
        if (script_note != null) {
            sQLiteStatement.bindString(8, script_note);
        }
        String script_context = shareBean.getScript_context();
        if (script_context != null) {
            sQLiteStatement.bindString(9, script_context);
        }
        String script_size = shareBean.getScript_size();
        if (script_size != null) {
            sQLiteStatement.bindString(10, script_size);
        }
        String script_pwd = shareBean.getScript_pwd();
        if (script_pwd != null) {
            sQLiteStatement.bindString(11, script_pwd);
        }
        String script_action_sum = shareBean.getScript_action_sum();
        if (script_action_sum != null) {
            sQLiteStatement.bindString(12, script_action_sum);
        }
        String user_scene = shareBean.getUser_scene();
        if (user_scene != null) {
            sQLiteStatement.bindString(13, user_scene);
        }
        String phone_size = shareBean.getPhone_size();
        if (phone_size != null) {
            sQLiteStatement.bindString(14, phone_size);
        }
        String soft_code = shareBean.getSoft_code();
        if (soft_code != null) {
            sQLiteStatement.bindString(15, soft_code);
        }
        String soft_version_code = shareBean.getSoft_version_code();
        if (soft_version_code != null) {
            sQLiteStatement.bindString(16, soft_version_code);
        }
        long j = 1;
        sQLiteStatement.bindLong(17, shareBean.getEnabled_down() ? 1 : 0);
        sQLiteStatement.bindLong(18, (long) shareBean.getNeed_acc_point());
        sQLiteStatement.bindLong(19, (long) shareBean.getDown_sum());
        if (!shareBean.getChecked_flag()) {
            j = 0;
        }
        sQLiteStatement.bindLong(20, j);
        String date = shareBean.getDate();
        if (date != null) {
            sQLiteStatement.bindString(21, date);
        }
        sQLiteStatement.bindLong(22, (long) shareBean.getGrade_num());
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public ShareBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        String string = cursor.isNull(i3) ? null : cursor.getString(i3);
        int i4 = i + 2;
        String string2 = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        String string3 = cursor.isNull(i5) ? null : cursor.getString(i5);
        int i6 = i + 4;
        String string4 = cursor.isNull(i6) ? null : cursor.getString(i6);
        int i7 = i + 5;
        String string5 = cursor.isNull(i7) ? null : cursor.getString(i7);
        int i8 = i + 6;
        String string6 = cursor.isNull(i8) ? null : cursor.getString(i8);
        int i9 = i + 7;
        String string7 = cursor.isNull(i9) ? null : cursor.getString(i9);
        int i10 = i + 8;
        String string8 = cursor.isNull(i10) ? null : cursor.getString(i10);
        int i11 = i + 9;
        String string9 = cursor.isNull(i11) ? null : cursor.getString(i11);
        int i12 = i + 10;
        String string10 = cursor.isNull(i12) ? null : cursor.getString(i12);
        int i13 = i + 11;
        String string11 = cursor.isNull(i13) ? null : cursor.getString(i13);
        int i14 = i + 12;
        String string12 = cursor.isNull(i14) ? null : cursor.getString(i14);
        int i15 = i + 13;
        String string13 = cursor.isNull(i15) ? null : cursor.getString(i15);
        int i16 = i + 14;
        String string14 = cursor.isNull(i16) ? null : cursor.getString(i16);
        int i17 = i + 15;
        String string15 = cursor.isNull(i17) ? null : cursor.getString(i17);
        boolean z = false;
        boolean z2 = cursor.getShort(i + 16) != 0;
        int i18 = cursor.getInt(i + 17);
        int i19 = cursor.getInt(i + 18);
        if (cursor.getShort(i + 19) != 0) {
            z = true;
        }
        int i20 = i + 20;
        return new ShareBean(valueOf, string, string2, string3, string4, string5, string6, string7, string8, string9, string10, string11, string12, string13, string14, string15, z2, i18, i19, z, cursor.isNull(i20) ? null : cursor.getString(i20), cursor.getInt(i + 21));
    }

    public void readEntity(Cursor cursor, ShareBean shareBean, int i) {
        int i2 = i + 0;
        String str = null;
        shareBean.setId(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        shareBean.setScript_id(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 2;
        shareBean.setScript_type_code(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        shareBean.setAccount_id(cursor.isNull(i5) ? null : cursor.getString(i5));
        int i6 = i + 4;
        shareBean.setScript_name(cursor.isNull(i6) ? null : cursor.getString(i6));
        int i7 = i + 5;
        shareBean.setScript_type_id(cursor.isNull(i7) ? null : cursor.getString(i7));
        int i8 = i + 6;
        shareBean.setScript_img(cursor.isNull(i8) ? null : cursor.getString(i8));
        int i9 = i + 7;
        shareBean.setScript_note(cursor.isNull(i9) ? null : cursor.getString(i9));
        int i10 = i + 8;
        shareBean.setScript_context(cursor.isNull(i10) ? null : cursor.getString(i10));
        int i11 = i + 9;
        shareBean.setScript_size(cursor.isNull(i11) ? null : cursor.getString(i11));
        int i12 = i + 10;
        shareBean.setScript_pwd(cursor.isNull(i12) ? null : cursor.getString(i12));
        int i13 = i + 11;
        shareBean.setScript_action_sum(cursor.isNull(i13) ? null : cursor.getString(i13));
        int i14 = i + 12;
        shareBean.setUser_scene(cursor.isNull(i14) ? null : cursor.getString(i14));
        int i15 = i + 13;
        shareBean.setPhone_size(cursor.isNull(i15) ? null : cursor.getString(i15));
        int i16 = i + 14;
        shareBean.setSoft_code(cursor.isNull(i16) ? null : cursor.getString(i16));
        int i17 = i + 15;
        shareBean.setSoft_version_code(cursor.isNull(i17) ? null : cursor.getString(i17));
        boolean z = true;
        shareBean.setEnabled_down(cursor.getShort(i + 16) != 0);
        shareBean.setNeed_acc_point(cursor.getInt(i + 17));
        shareBean.setDown_sum(cursor.getInt(i + 18));
        if (cursor.getShort(i + 19) == 0) {
            z = false;
        }
        shareBean.setChecked_flag(z);
        int i18 = i + 20;
        if (!cursor.isNull(i18)) {
            str = cursor.getString(i18);
        }
        shareBean.setDate(str);
        shareBean.setGrade_num(cursor.getInt(i + 21));
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(ShareBean shareBean, long j) {
        shareBean.setId(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(ShareBean shareBean) {
        if (shareBean != null) {
            return shareBean.getId();
        }
        return null;
    }

    public boolean hasKey(ShareBean shareBean) {
        return shareBean.getId() != null;
    }
}
